<!-- 轮播 -->
<template>
    <el-carousel trigger="click" class="carousel-list">
        <el-carousel-item class="item" :style="swiperBg('')">
            <div class="panel">
                <div class="title">应用创新 产业数字化 业务拖拽生成</div>
                <div class="desc">
                    智能应用依托于平台开放的能力,以AI驱动赋能,致力于数字化转型的
                    SaaS 平台.
                </div>
                <el-button size="small" @click="$router.push('/list')">
                    快速开始
                </el-button>
            </div>
        </el-carousel-item>
        <!-- <el-carousel-item v-for="(item, index) in swiperList" :key="index">
                <div class="swiper-item" >
                <div class="item-panel-con">
                    <div class="item-panel">
                        <div class="item-title">
                            {{item.title}}
                        </div>
                        <div class="item-content">
                            {{item.content}}
                        </div>
                    </div>
                    <div class="item-animate" :style="swiperBg(item.image)"></div>
                </div>
            </div>
        </el-carousel-item> -->
    </el-carousel>
</template>
<script lang="ts" setup>
import { computed } from 'vue'
import { requireImg } from '@/utils/util.ts'

const swiperBg = computed(() => {
    return (image: string) => {
        const _image = image || requireImg('home/carousel_bg_1.png')
        return {
            background: `url(${_image}) no-repeat`,
            backgroundSize: '80% 100%',
            backgroundPosition: 'right center',
        }
    }
})
</script>

<style lang="scss" scoped>
.carousel-list {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(
        to right,
        var(--color-primary),
        var(--color-primary)
    );
    :deep(.el-carousel__container) {
        height: 100% !important;
    }
    .item {
        height: 100%;
        width: 100%;
        position: relative;
        .panel {
            width: 75%;
            transform: translate(10%, 30%);
            position: relative;
            color: var(--color-white);
            .title {
                height: 36px;
                line-height: 36px;
                font-size: 16px;
                font-weight: 600;
            }
            .desc {
                width: 70%;
                font-size: 12px;
                padding: 15px 0px;
                line-height: 22px;
            }
            button {
                width: 100px;
                height: 32px;
                background: var(--color-white);
                border-radius: 4px;
                color: var(--color-primary);
                border: 0;
                margin-top: 10px;
            }
        }
    }
}
</style>
